﻿using Abp.AutoMapper;
using AVIS.OutBound.WizardAgent;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AVIS.OutBound.CarGroups
{
    /// <summary>
    /// 车组（同组车型）的信息
    /// </summary>
    [AutoMapFrom(typeof(CarGroupDto))]
    [Serializable]
    public class CarGroup
    {
        public CarGroup()
        {
            Feature = new CarFeature();
            PriceInclue = new PriceInclude();
            CarEquipments = new List<CarEquipment>();
        }

        /// <summary>
        /// 套餐价格代码
        /// </summary>
        public string RateCode { get; set; }

        /// <summary>
        /// 车组名称（如：Group A - Volkswagen Polo or similar）
        /// </summary>
        public string ModelName { get; set; }

        /// <summary>
        /// 车组编号（如：A,C,Z,L,W,XP中的任一个）
        /// </summary>
        public string ModelCode { get; set; }

        /// <summary>
        /// 预订车组的唯一码
        /// </summary>
        public string SIPPCode { get; set; }

        /// <summary>
        /// 价格
        /// </summary>
        public double Price { get; set; }

        /// <summary>
        /// 货币单位
        /// </summary>
        public string CurrencyCode { get; set; }

        /// <summary>
        /// 车型组的图片信息
        /// </summary>
        public string PictureURL
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_PictureURL))
                {
                    return _PictureURL;
                }

                if (!string.IsNullOrWhiteSpace(_PictureURL) && !(_PictureURL.Contains("/Content/images/") || _PictureURL.Contains("http")))
                {
                    return string.Format(SiteConfig.AvisVehicleImgUrl, _PictureURL);
                }

                return _PictureURL;
            }
            set
            {
                _PictureURL = value;
            }
        }
        private string _PictureURL = string.Empty;


        /// <summary>
        /// 排序号
        /// </summary>
        public int SeqNo { get; set; }

        /// <summary>
        /// 是否为推荐车组
        /// </summary>
        public bool IsRecommend { get; set; }

        /// <summary>
        /// 车组套餐信息，套餐价格包含的详细内容（行驶限制、保险项目、费用）
        /// </summary>
        public PriceInclude PriceInclue { get; set; }

        /// <summary>
        /// 车辆功能特征（比如：自动挡、4座等）
        /// </summary>
        public CarFeature Feature { get; set; }

        /// <summary>
        /// 车辆装备等增值服务（如：儿童座椅、(GPS) 导航仪等）
        /// </summary>
        public List<CarEquipment> CarEquipments { get; set; }
    }
}
